package top.laoshuzi.cloudplatform.tools;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

import top.laoshuzi.cloudplatform.App;


/**
 * Created by Mouse on 2017/1/9.
 */

public class PreferHelper {

    private static PreferHelper instance = null;

    private SharedPreferences sharedGlobal;
    private SharedPreferences sharedPreferences;
    private Context context;

    private PreferHelper() {
        this.context = App.getContext();
        this.sharedGlobal = PreferencesUtil.getSharedGlobal(context);
        this.sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
    }

    public static PreferHelper getInstance() {
        if (instance == null)
            instance = new PreferHelper();
        return instance;
    }

    /**
     * sharedGlobal
     */

    public void setCutVideoLastTime(long cutVideoLastTime) {
        SharedPreferences.Editor editor = sharedGlobal.edit();
        editor.putLong("cutVideoLastTime", cutVideoLastTime);
        editor.commit();
    }

    public long getCutVideoLastTime() {
        return sharedGlobal.getLong("cutVideoLastTime", 0);
    }

}
